package com.yimicloud.common.system;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

/**
 * Created by Justin on 2015/9/7.
 */
public class ContextHelper {
    private Properties systemProps;
    private static Properties props = new Properties();

    static {
        try {
            InputStream input = ContextHelper.class.getClassLoader().getResourceAsStream("config.properties");
            if (input != null) {
                props.load(input);
            }
        } catch (IOException var1) {
            ;
        }

    }

    public ContextHelper() {
    }

    public Properties getSystemProps() {
        this.systemProps = new Properties();
        InputStream fis = this.getClass().getClassLoader().getResourceAsStream("config.properties");

        try {
            this.systemProps.load(fis);
        } catch (IOException var11) {
            var11.printStackTrace();
        } finally {
            try {
                fis.close();
            } catch (IOException var10) {
                var10.printStackTrace();
            }

        }

        return this.systemProps;
    }

    public static String getConfig(String name) {
        return props.getProperty(name);
    }

    public static void main(String[] args) {
        System.out.println(getConfig("pom.freemark.path.linux"));
    }
}

